<%@ page language="java" import="java.util.*,java.text.*" pageEncoding="utf-8"%>
<%@page import="issuedfileaction.DBConnection;"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>       
    <title>查询日监控信息</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
  <%
      SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
      String BeginTime=request.getParameter("begintime");
      String EndTime=request.getParameter("endtime");
      BeginTime=sdf.format(sdf.parse(BeginTime));
      EndTime=sdf.format(sdf.parse(EndTime));
      String CustomerName="";
      String StandMan="";
      String TransType="";
      String Province="";
      String FlowState="";
      try{
         CustomerName=new String(request.getParameter("customername").getBytes("ISO-8859-1"),"utf-8");
      }catch(Exception e){
         CustomerName="";
      }      
      try{
         StandMan=new String(request.getParameter("standman").getBytes("ISO-8859-1"),"utf-8");
      }catch(Exception e){
         StandMan="";
      }            
      try{
         TransType=new String(request.getParameter("transtype").getBytes("ISO-8859-1"),"utf-8");
      }catch(Exception e){
         TransType="";
      }            
      try{
         Province=new String(request.getParameter("province").getBytes("ISO-8859-1"),"utf-8");
      }catch(Exception e){
         Province="";
      }      
      try{
         FlowState=new String(request.getParameter("flowstate").getBytes("ISO-8859-1"),"utf-8");
      }catch(Exception e){
         FlowState="";
      }            
      String[] FlowStateArray=FlowState.split(",");
      String TransPurChase="N";
      String TransSale="N";
      String TransStock="N";
      for(int i=0;i<FlowStateArray.length;i++){
          if(FlowStateArray[i].equals("采购")){
             TransPurChase="Y";
          }else if(FlowStateArray[i].equals("销售")){
             TransSale="Y";
          }else if(FlowStateArray[i].equals("库存")){
             TransStock="Y";
          }
      }            
      List<Object> ListRows=new ArrayList<Object>();
      DBConnection db=new DBConnection();
      ListRows=db.SQLProListExec("{call DAYCONSOLE.PRO_DAYREAD(?,?,?,?,?,?,?,?,?,?,?,?,?)}",BeginTime,EndTime,CustomerName,StandMan,TransType,Province,TransPurChase,TransSale,TransStock);
	  HttpSession httpSession = request.getSession();         
      httpSession.setAttribute("ListRows", ListRows);	
      httpSession.setAttribute("BeginTime",BeginTime);
      httpSession.setAttribute("EndTime",EndTime);
      httpSession.setAttribute("CustomerName",CustomerName);
      httpSession.setAttribute("StandMan",StandMan);
      httpSession.setAttribute("TransType",TransType);
      httpSession.setAttribute("Province",Province);
      httpSession.setAttribute("FlowState",FlowState);              		    	  
	  response.sendRedirect("monitor.jsp");     
  %>
  </body>
</html>
